import Vue from 'vue'
import axios from 'axios'
const instance = axios.create({
	baseURL: Vue.prototype.fileUrl,
	timeout: 100000
});

export const baseParams = {
	fkId: '',
	version: '1'
}
export const chunkSize = 20 * 1024 * 1024;
export const checkUpload = Vue.prototype.fileUrl + 'tbSysAttachment/uploadFile_create';
export const chunkUpload = Vue.prototype.fileUrl + 'tbSysAttachment/uploadFile_par';
export const baseUpload = Vue.prototype.fileUrl + 'tbSysAttachment/upload';

//删除分片上传
export function deleteChunkedUpload(data, headers) {
	return instance({
		url: 'tbSysAttachment/closeFile',
		method: 'post',
		data,
		headers
	})
}
//合并分片文件
export function mergeChunkedUpload(data, headers) {
	return instance({
		url: 'tbSysAttachment/mergeFile',
		method: 'post',
		data,
		headers
	})
}
